var fs = require('fs');
var path = require('path');
var DxfStruct = require('./DxfStruct2');
var DxfParser = require('../');

var DXF_FILE_PATH = path.join(__dirname, 'data', 'lines.dxf');
var OUTPUT_FILE_NAME = "cad.json";

var fileStream = fs.createReadStream(DXF_FILE_PATH, { encoding: 'utf8' });
var parser = new DxfParser();
var layer_color = {}
fs.readFile('list.json',function(err,data){
    if (err) return console.error(err.stack);
    var dxf = data.toString();//将二进制的数据转换为字符串
    dxf = JSON.parse(dxf);//将字符串转换为json对象
    fs.readFile('list1.json',function(err,e){
        if (err) return console.error(err.stack);
        var dxf2 = e.toString();//将二进制的数据转换为字符串
        dxf2 = dxf.concat(JSON.parse(dxf2));//将字符串转换为json对象
        console.log(dxf2.length)
        fs.writeFileSync('list.json', JSON.stringify(dxf2));
    })
})
